<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.sql.*" errorPage=""%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta nnme="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
	<jsp:useBean id="LogBean" scope="session" class="Bean.dbConn"/>
<%
request.setCharacterEncoding("UTF-8");

String aduser = request.getParameter("aduser");
String adpassword = request.getParameter("adpassword");

ResultSet rs = null;


	rs = LogBean.executeQuery("SELECT * FROM admin where aduser=" + "'"+ aduser +"'" + "and adpassword=" + "'" + adpassword + "'");
	
if(rs.next()) {
	session.setAttribute("user",aduser);
	response.sendRedirect("testlist.jsp");
} else {
	out.print("<script> alert('密码或用户名错误！'); window.location.href='adminlogin.html'; </script>");
	}

	
	LogBean.closeConn();



%>

</body>
</html>